package unit3;

public class Ex3_14_AccessTest {
    public static void main(String args[]) {
        Test1 obj = new Test1();
        obj.a = 10;
        obj.b = 20;
        obj.setc(100);
        System.out.println("a，b，and c: " + obj.a + " " + obj.b + " " + obj.getc());
    }
}
class Test1 {
    int a = 3;
    int b = 5;
    int c = 10;
    public void setc(int i) {
        int c = i; //声明局部变量c，与成员变量c同名
    }
    public int getc() {
        return c;
    }
}
